import { $Http } from '@/config/service/http';

export enum Api {
  // 档案目录管理
  folderAdd = '/dms/archives/folder/add', // 添加档案目录
  folderDelete = '/dms/archives/folder/delete', // 删除档案目录
  folderGet = '/dms/archives/folder/get', // 获取
  folderPage = '/dms/archives/folder/page', // 分页查询档案目录
  folderTree = '/dms/archives/folder/tree', // 查询档案目录树
  folderUpdate = '/dms/archives/folder/update', // 修改档案目录
  folderUpdateStatus = '/dms/archives/folder/updateStatus', // 修改档案目录状态
  folderfindCanUseTree = '/dms/archives/folder/findCanUseTree', // 查询开启状态的档案目录树
  // 档案类型管理
  typeAdd = '/dms/archives/type/add', // 添加档案类型
  typeDelete = '/dms/archives/type/delete', // 删除档案类型
  typeGet = '/dms/archives/type/get', // 获取
  typePage = '/dms/archives/type/page', // 分页查询档案类型
  typeTree = '/dms/archives/type/tree', // 查询档案类型树
  typeUpdate = '/dms/archives/type/update', // 修改档案类型
  typeUpdateStatus = '/dms/archives/type/updateStatus', // 修改状态
  typefindCanUseTree = '/dms/archives/type/findCanUseTree', // 查询开启状态的档案类型树
  // 档案盒管理
  boxAdd = '/dms/archives/box/add', // 添加档案盒
  boxDelBatch = '/dms/archives/box/delBatch', // 删除档案盒
  boxExportAll = '/dms/archives/box/exportAll', // 全部导出档案盒数据
  boxCanUseBox = '/dms/archives/box/findCanUseBox', // 根据地点查询所有能使用的档案盒
  boxGet = '/dms/archives/box/get', // 获取
  boxPage = '/dms/archives/box/transferPage', // 分页查询档案盒
  boxPreviewCatalog = '/dms/archives/box/previewCatalog', // 预览目录
  boxPrintArchivesBoxDirectory = '/dms/archives/box/printArchivesBoxDirectory', // 打印案卷目录
  boxPrintBoxWithInDirectory = '/dms/archives/box/printBoxWithInDirectory', // 打印卷内目录
  boxPrintCoverOrSpine = '/dms/archives/box/printCoverOrSpine', // 打印封面或脊背
  boxSelectExport = '/dms/archives/box/selectExport', // 选中导出档案盒数据
  boxUpdate = '/dms/archives/box/update', // 修改档案盒
  boxUpdateStatus = '/dms/archives/box/updateStatus' // 修改档案盒状态
}

export const folderAdd = (params) => {
  return $Http.api(Api.folderAdd, params, 'post');
};

export const folderDelete = (id) => {
  return $Http.api(`${Api.folderDelete}/${id}`, null, 'get');
};

export const folderGet = (id) => {
  return $Http.api(`${Api.folderGet}/${id}`, null, 'get');
};

export const folderTree = (params) => {
  return $Http.api(Api.folderTree, params, 'post');
};

export const folderUpdate = (params) => {
  return $Http.api(Api.folderUpdate, params, 'post');
};

export const folderUpdateStatus = (params) => {
  return $Http.api(Api.folderUpdateStatus, params, 'get');
};

export const folderfindCanUseTree = (params) => {
  return $Http.api(Api.folderfindCanUseTree, params, 'post');
};

export const typefindCanUseTree = (params) => {
  return $Http.api(Api.typefindCanUseTree, params, 'post');
};

export const typeAdd = (params) => {
  return $Http.api(Api.typeAdd, params, 'post');
};

export const typeDelete = (id) => {
  return $Http.api(`${Api.typeDelete}/${id}`, null, 'get');
};

export const typeGet = (id) => {
  return $Http.api(`${Api.typeGet}/${id}`, null, 'get');
};

export const typeTree = (params) => {
  return $Http.api(Api.typeTree, params, 'post');
};

export const typeUpdate = (params) => {
  return $Http.api(Api.typeUpdate, params, 'post');
};

export const typeUpdateStatus = (params) => {
  return $Http.api(Api.typeUpdateStatus, params, 'get');
};

export const boxAdd = (params) => {
  return $Http.api(Api.boxAdd, params, 'post');
};

export const boxGet = (id) => {
  return $Http.api(`${Api.boxGet}/${id}`, null, 'get');
};

export const boxUpdate = (params) => {
  return $Http.api(Api.boxUpdate, params, 'post');
};

export const boxPreviewCatalog = (params) => {
  return $Http.api(Api.boxPreviewCatalog, params, 'post');
};

export const boxPrintArchivesBoxDirectory = (params) => {
  return $Http.api(Api.boxPrintArchivesBoxDirectory, params, 'post');
};

export const boxPrintBoxWithInDirectory = (params) => {
  return $Http.api(Api.boxPrintBoxWithInDirectory, params, 'post');
};

export const boxPrintCoverOrSpine = (params) => {
  return $Http.api(Api.boxPrintCoverOrSpine, params, 'post');
};
